package com.kpx.app.bean;

import java.io.Serializable;

/**
 * 作者： Ryan
 * 创建时间： 15/9/7 10:24
 * 类描述：商品
 */
public class Goods implements Cloneable, Serializable {
    public static final int GOODS_STATUS_OFF_SHELF = 1;
    public static final int COUPON_DISSUPPORT = 1;
    public static final int GOODS_ACTION_ADD = 1;
    public static final int GOODS_ACTION_MODIFY = 2;
    public static final int GOODS_ACTION_SHOW = 3;
    public static final int GOODS_ACTION_PUT_ONSHELF = 4;
    public static final int GOODS_ACTION_PUT_OFFSHELF = 5;

    /**
     * 商品创建时间
     */
    private long crtime;
    /**
     * 商品 id
     */
    private long dmId;
    /**
     * 商品都在分类 id
     */
    private long goodsCategoryId;
    /**
     * 商品名称
     */
    private String goodsName;
    /**
     * 产品照片
     */
    private String imgs;
    /**
     * 每日限量
     */
    private int limited;
    /**
     * 销售数量
     */
    private int sales;
    /**
     * 商品所在的商店 id
     */
    private long sellerStoreId;
    /**
     * 0 在售 1下架
     */
    private int status;
    /**
     * 商品主人 id
     */
    private long userId;
    /**
     * 产品价格
     */
    private float price;
    /**
     * 选中数量
     */
    private int selectCount;

    private int isCoupon;

    private int mAction;

    public int getmAction() {
        return mAction;
    }

    public void setmAction(int mAction) {
        this.mAction = mAction;
    }

    public int getIsCoupon() {
        return isCoupon;
    }

    public void setIsCoupon(int isCoupon) {
        this.isCoupon = isCoupon;
    }

    public long getCrtime() {
        return crtime;
    }

    public void setCrtime(long crtime) {
        this.crtime = crtime;
    }

    public long getDmId() {
        return dmId;
    }

    public void setDmId(long dmId) {
        this.dmId = dmId;
    }

    public long getGoodsCategoryId() {
        return goodsCategoryId;
    }

    public void setGoodsCategoryId(long goodsCategoryId) {
        this.goodsCategoryId = goodsCategoryId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getImgs() {
        return imgs;
    }

    public void setImgs(String imgs) {
        this.imgs = imgs;
    }

    public int getLimited() {
        return limited;
    }

    public void setLimited(int limited) {
        this.limited = limited;
    }

    public int getSales() {
        return sales;
    }

    public void setSales(int sales) {
        this.sales = sales;
    }

    public long getSellerStoreId() {
        return sellerStoreId;
    }

    public void setSellerStoreId(long sellerStoreId) {
        this.sellerStoreId = sellerStoreId;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public int getSelectCount() {
        return selectCount;
    }

    public void setSelectCount(int selectCount) {
        this.selectCount = selectCount;
    }

    @Override
    public boolean equals(Object o) {

        if (o != null && o instanceof Goods) {
            Goods another = (Goods) o;
            return another.getDmId() == dmId;
        }

        return super.equals(o);
    }

    @Override
    public String toString() {
        //        if (!BuildConfig.DEBUG) {
        //            return super.toString();
        //        }
        return "Goods{" +
                "crtime=" + crtime +
                ", dmId=" + dmId +
                ", goodsCategoryId=" + goodsCategoryId +
                ", goodsName='" + goodsName + '\'' +
                ", imgs='" + imgs + '\'' +
                ", limited=" + limited +
                ", sales=" + sales +
                ", sellerStoreId=" + sellerStoreId +
                ", status=" + status +
                ", userId=" + userId +
                ", price=" + price +
                ", isCoupon=" + isCoupon +
                ", mAction=" + mAction +
                '}';
    }

    @Override
    public Object clone() {
        try {
            return super.clone();
        } catch (Exception e) {
            e.printStackTrace();
        }
        //        Goods goods = null;
        //        try {
        //            goods = (Goods) super.clone();
        //        } catch (CloneNotSupportedException e) {
        //            e.printStackTrace();
        //        }
        //        return goods;
        return null;
    }
}
